import request from '@/utils/request.js'
import {useTokenStore} from "@/stores/token.js";

export const rechargeInfoService=(params)=>{
    return request.get('/recharge/rechargeinfo',{params:params})
}

export const R_rechargeInfoService=(params)=>{
    return request.get('/recharge/r-rechargeinfo',{params:params})
}

export const rechargeNewRecordService=(rechargeData)=>{
    const params=new URLSearchParams();
    for(let key in rechargeData){
        params.append(key,rechargeData[key])
    }
    return request.post('/recharge/newrecharge',params)
}

export const rechargeRecordDownloadService=(recordid)=>{
    const params=new URLSearchParams();
    params.append('recordid',recordid)
    return request.get('/recharge/downloadrecharge',{params})
}

export const cancelPayService=(recordid)=>{
    const params=new URLSearchParams();
    params.append('recordid',recordid)
    return request.post('/recharge/cancelrecharge',params)
}
